﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis.Core;
using System.ComponentModel.DataAnnotations;

namespace Tanmia.Core
{
    public class Statement : BaseBusinessObject
    {
        private StatementTypeEnum statementType;
        private Person person;
        private StatementDateTypeEnum statementDateType;
        private DateTime from;
        private DateTime to;

        [Display(Name = "نوع الكشف: ", ShortName = "نوع الكشف", Order = 0)]
        public StatementTypeEnum StatementType
        {
            get { return statementType; }
            set { SetValue<StatementTypeEnum>("StatementType", ref statementType, value); }
        }

        [Display(Name = "الزبون / المورد: ", ShortName = "الزبون / المورد", Order = 1)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "لايمكن للحقل {0} أن يكون فارغاً")]
        [AllowSelect(ErrorMessage = "يجب عليك أن تختار أحد الخيارت من الحقل {0}")]
        public Person Person
        {
            get { return person; }
            set { SetValue<Person>("Person", ref person, value); }
        }

        [Display(Name = "تاريخ الكشف: ", ShortName = "تاريخ الكشف", Order = 2)]
        public StatementDateTypeEnum StatementDateType
        {
            get { return statementDateType; }
            set { SetValue<StatementDateTypeEnum>("StatementDateType", ref statementDateType, value); }
        }

        [Display(Name = "من التاريخ: ", ShortName = "من التاريخ", Order = 3)]
        [DataType(DataType.DateTime)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "لايمكن للحقل {0} أن يكون فارغاً")]
        public DateTime From
        {
            get { return from; }
            set { SetValue<DateTime>("From", ref from, value); }
        }

        [Display(Name = "إلى التاريخ: ", ShortName = "إلى التاريخ", Order = 4)]
        [DataType(DataType.DateTime)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "لايمكن للحقل {0} أن يكون فارغاً")]
        public DateTime To
        {
            get { return to; }
            set { SetValue<DateTime>("To", ref to, value); }
        }

    }
}
